#include "widget.h"
#include "ui_widget.h"
#include<QDebug>
#include<QRect>

Widget::Widget(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Widget)
{
    ui->setupUi(this);

}

Widget::~Widget()
{
    delete ui;
}


void Widget::on_pushButton_up_clicked()
{
    QRect ret =ui->pushButton->geometry();
//    ui->pushButton->setGeometry(ret.x(),ret.y()-5,ret.width(),ret.height());
    ui->pushButton->move(ret.x(),ret.y()-5);
}

void Widget::on_pushButton_left_clicked()
{
    QRect ret = ui->pushButton->geometry();
  //  ui->pushButton->setGeometry(ret.x()-5,ret.y(),ret.width(),ret.height());
    ui->pushButton->move(ret.x()-5,ret.y());
}

void Widget::on_pushButton_right_clicked()
{
    QRect ret = ui->pushButton->geometry();
   // ui->pushButton->setGeometry(ret.x()+5,ret.y(),ret.width(),ret.height());
     ui->pushButton->move(ret.x()+5,ret.y());
}

void Widget::on_pushButton_down_clicked()
{
    QRect ret = ui->pushButton->geometry();
    //ui->pushButton->setGeometry(ret.x(),ret.y()+5,ret.width(),ret.height());
  ui->pushButton->move(ret.x(),ret.y()+5);
}
